package main

import (
	"fmt"
	rand2 "math/rand"
)

func main() {
	name1 := []string{"aa", "bb", "cc", "dd", "ee", "ff", "gg", "hh", "ii", "jj"}
	rand1(name1)
}

func rand1(names []string) {
	var a string
	for len(names) > 1 {
		rd := (rand2.Int() % len(names))
		fmt.Println("恭喜", names[rd], "同学被抽中")
		names = append(names[:rd], names[rd+1:]...)
		fmt.Println(names)
		//cmd := exec.Command("cmd", "/C", "pause")
		//cmd.Stdin = os.Stdin
		//cmd.Stdout = os.Stdout
		//_ = cmd.Run()
		fmt.Println("输入任意内容继续，输入q退出")
		fmt.Scan(&a)
		if a == "q" {
			break
		}

	}
}
